#include"tcpsocket.hpp"

int main()
{
    TcpSocket cli_sock;
    cli_sock.createClient(9000);
    while(1){
        std::string buf;
        std::cout<<"client say: ";
        fflush(stdout);
        std::cin>>buf;
        bool ret = cli_sock.Send(buf);
        if(ret == false){
            cli_sock.Close();
            return -1;
        }
        buf.clear();
        ret = cli_sock.Recv(buf);
        if(ret == false){
            cli_sock.Close();
            return -1;
        }
        std::cout<<"server say: "<<buf<<std::endl;
    }
    cli_sock.Close();
    return 0;
}